// Notification.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "Notification.h"
#include "jwsmtp.h"

#include <string>
//#include <vector>
//#include <list>
#include <iostream>
//#include <assert.h>



Notification::Notification()
{
}

Client Notification::getClient()
{
	return _client;
}

Movie Notification::getMovie()
{
	return _movie;
}

void Notification::sendEmail(MemberDetails _memberDet)
{
	
	// jwSMTP is a C++ library/code (GPL license) to facilitate sending email programmatically.
	
	jwsmtp::mailer mail;
	mail.addrecipient(_memberDet.getEmail());
	mail.setsender("eng.amr.m@gmail.com");
	mail.setsubject("subject of mail");
	mail.setmessage("the movie: " + _movie.getName() + " is now available " );
	mail.setserver("localhost");

/*	std::string htmlmessage("<html>"
		"<body>"
		"This is the html part of the message<br /><br />"
		"<b>bold</b><br />"
		"<i>italic</i><br />"
		"<font size=\"7\">Large Text</font><br /><br />"
		"Or a link: <a href=\"http://mumbleface.net\">mumbleface.net</a><br /><br />"
		"And an image: <br><img alt=\"an image in email\" src=\"http://mumbleface.net/jwsmtp/example.png\"><br />"
		"</body>"
		"</html>");
	mail.setmessageHTML(htmlmessage); */

	mail.send();

}

/*void Notification::sendEmail(Member member_)
{
}*/
